<template>
   
  <router-view></router-view>

</template>

<script setup>
import { ref, onMounted } from 'vue'
import { ElMessageBox } from 'element-plus'
import axios from 'axios'


let getVersion = ref('')
onMounted(() => {
  // 检查版本
  getVersion.value = setInterval(() => {
    getVer()
  }, 30000)
})

async function getVer() {
  let timestamp = new Date().getTime()
  let res = await axios.get(
    `${window.location.protocol}//${window.location.host}/version.json?timestamp=${timestamp}`
  )
  if (res) {
    let currentVersion = res.data.version
    if (!currentVersion) return
    let onLineVersion = localStorage.getItem('oow-platform-version')
    if (!onLineVersion) {
      localStorage.setItem('oow-platform-version', currentVersion)
    } else {
      if (currentVersion !== onLineVersion) {
        localStorage.setItem('oow-platform-version', currentVersion)
        clearInterval(getVersion.value)
        ElMessageBox.alert('检测到系统版本已更新，请刷新浏览器以获取最新内容', '更新提示', {
          confirmButtonText: '立即刷新',
          showClose: false,
          callback: (action) => {
            window.location.reload()
          }
        })
      }
    }
  }
}
</script>

<style lang="less">
.custom-dropdown {
  z-index: 20000 !important;
}
.el-message {
  z-index: 30000 !important;
}
.svg-icon {
  &.svg-111 {
    color: #111;
  }
  &.svg-fff {
    color: #fff;
  }
  &.svg-2785FF {
    color: #2785ff;
  }
  &.svg-7285A0 {
    color: #7285A0;
  }
}
.el-dialog.account-dialog-container {
  border-radius: 12px;
}
.el-dialog.account-dialog-container .el-dialog__header {
  padding: 0;
  margin: 0;
}
.el-dialog.account-dialog-container .el-dialog__body {
  padding: 0;
  margin: 0;
}

.flex {
  display: flex;
  flex-direction: row;
}

.flex-row {
  flex-direction: row;
}

.flex-column {
  flex-direction: column !important;
}

.flex-1 {
  flex: 1 !important;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-ac {
  align-items: center !important;
}

.flex-as {
  align-items: flex-start;
}

.flex-ae {
  align-items: flex-end;
}

.flex-dc {
  flex-direction: column !important;
}

.jc-sb {
  justify-content: space-between;
}

.jc-sa {
  justify-content: space-around;
}

.jc-start {
  justify-content: flex-start;
}

.jc-ct {
  justify-content: center;
}

.jc-end {
  justify-content: flex-end;
}

.flex-ac-start {
  align-content: flex-start;
}

.as-start {
  align-self: flex-start;
}
/* #endif */
/*溢出显示省略号*/
.nowrap {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.nowrap2 {
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.nowrap3 {
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.nowrap4 {
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}



</style>
